package cn.edu.lzzy.mypractices.service;

import cn.edu.lzzy.mypractices.constant.Messages;
import cn.edu.lzzy.mypractices.entity.Chapter;
import cn.edu.lzzy.mypractices.entity.Option;
import cn.edu.lzzy.mypractices.entity.Question;

import java.util.List;
import java.util.UUID;

public interface QuestionService { // 题目服务
    // 根据章节获取所有章节下的问题
    List<Question> getAllByChapter(Chapter chapter);
    List<Question> getAllByChapter(UUID uuid);

    List<Question> getAllByChapter(Chapter chapter, int page, int size);
    List<Question> getAllByChapter(UUID uuid, int page, int size);

    Question getByQuestionId(UUID uuid);

    int count(Chapter chapter);
    int count(UUID chapter_id);

    // 新增问题
    Question addQuestion(Question questionIn);
    // 编辑问题
    Question updateQuestion(Question questionIn);
    // 删除问题
    Messages removeQuestion(UUID questionIn, String token);

    // 获取所有问题下的选项
    List<Option> getAllByQuestion(Question question);
    List<Option> getAllByQuestion(UUID uuid);

    Option getByOptionId(UUID uuid);

    Option addOption(Option option);
    Option updateOption(Option option);
    Messages removeOption(UUID optionIn, String token);
}
